{% load static %}
<header class="header-area">
    <!-- Navbar Area -->
    <div class="newsbox-main-menu">
        <div class="classy-nav-container breakpoint-off">
            <div class="container-fluid">
                <!-- Menu -->
                <nav class="classy-navbar justify-content-between" id="newsboxNav">

                    <!-- Nav brand -->
                    <a href="{%url 'home-page'%}" class="nav-brand"><img src="{% static 'img/core-img/logo.png' %}" alt=""></a>

                    <!-- Navbar Toggler -->
                    <div class="classy-navbar-toggler">
                        <span class="navbarToggler"><span></span><span></span><span></span></span>
                    </div>

                    <!-- Menu -->
                    <div class="classy-menu">

                        <!-- Close Button -->
                        <div class="classycloseIcon">
                            <div class="cross-wrap"><span class="top"></span><span class="bottom"></span></div>
                        </div>

                        <!-- Nav Start -->
                        <div class="classynav">
                            <ul>
                                <li><a href="{%url 'home-page'%}">主页</a>
                                {% if not user.id %}
                                <li><a href="{% url 'login-page' %}">登录</a></li>
                                {% else %}
                                <li>
                                    <a href="#">你好, {{user.username}}</a>
                                    <ul class="dropdown">
                                        <li><a href="{% url 'profile-page' %}">个人信息简介</a></li>
                                        <li><a href="{% url 'new-post' %}">发表新文章</a></li>
                                        <li><a href="{% url 'all-posts' %}">全部文章</a></li>
                                        <li><a href="{% url 'logout' %}">退出登录</a></li>
                                    </ul>
                                </li>
                                {% endif %}
                            </ul>

                        </div>
                        <!-- Nav End -->

                    </div>
                </nav>
            </div>
        </div>
    </div>
</header>
